<?php
include '../../include/db.php';
$activityId = $_REQUEST["id"];
$name = $_REQUEST["name"];
$voteData = $_REQUEST["voteData"];
$countVotes = $_REQUEST["countVotes"];
$time = date('Y-m-d g:i:s');
InsertVoteData($activityId, $name, $voteData, $time);
echo '<tr class="participant">
  		<td class="pname long">
      		<div class="inlineEdit" style="display: none;">
      			<a class="inlineEditIcon "></a>
      			<a class="inlineDeleteIcon"></a>
      		</div>
      		<div class="pname" title="'.$name.'">
      			'.$name.'
      		</div>
  		</td>';
  for ($i = 0; $i < $countVotes; $i++) {
      if($voteData % 2)
      {
          echo '<td class="y">
  					<div class="partTableCell pok"></div>
      			</td>';
      }
      else
      {
          echo '<td class="n">
      				<div class="partTableCell pn"></div>
      			</td>';
      }
      $voteData /= 2;
  } 
echo "</tr>";